package net.wanho.controller;

import lombok.extern.slf4j.Slf4j;
import net.wanho.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * Author：汤小洋
 * Date：2024-03-22 9:21
 * Description：<描述>
 */
@Slf4j
@RestController
public class HelloController {

    @RequestMapping("/hello")
    public String hello(){

        try {
            int a = 5/2;
            log.info("正常执行。。。。");
        } catch (Exception e) {
            log.error("发生异常:" + e.getMessage());
            throw new RuntimeException(e);
        }

        return "hello springboot11111";
    }

    @RequestMapping("/addUser")
    public String addUser(@Valid User user){
        System.out.println(user);
        return "success";
    }


}
